home *** CD-ROM | disk | FTP | other *** search
/ Amiga Games: Greatest Hits 1996 / Amiga Games: Greatest Hits 1996.iso / userbox / publicdomain / gedscanner / adocscan.asm < prev    next >
Assembly Source File  |  1996-07-22  |  868b  |  38 lines

  1. ; GoldED scanner for autodocs, even for MUI-autodocs ;-)
  2. ; it recognizes entrys of the following form: 'ff'<docname>'/'<ENTRYNAME>
  3.  
  4.             movem.l a1-a2/d1-d3,-(SP)
  5.             move.l  d0,d1           ; line length 
  6.         moveq.l #0,d0
  7.         moveq.l #0,d2        ; actual cursorpos
  8.             movea.l (a0),a1
  9.         cmpi.b    #12,(a1)
  10.         bne    end        ; line have to start with formfeed
  11.  
  12. slash        cmp.w    d2,d1        ; don`t search after lineend
  13.         beq    end
  14.         addq.w    #1,d2
  15.         cmpi.b    #"/",(a1)+    ; searching slash 
  16.         beq    entryname
  17.         bra    slash
  18.  
  19. entryname    move.w    d2,d3        ; remember namestart offset
  20.         move.l    a1,(a0)        ; entry name start
  21. entryloop    cmpi.b    #" ",(a1)    ; searching white space
  22.         beq    entryend
  23.         cmpi.b    #9,(a1)
  24.         beq    entryend
  25.         cmpi.b    #10,(a1)+
  26.         beq    entryend
  27.         cmp.w    d2,d1
  28.         beq    entryend
  29.         addq.w    #1,d2
  30.         bra     entryloop
  31.  
  32. entryend    move.w    d2,d0
  33.         sub.w    d3,d0
  34.  
  35. end            movem.l (SP)+,a1-a2/d1-d3
  36.             rts
  37.  
  38.